package mn.idax.exchange.otc.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Auther: shihaiming
 * @Date: 2018/08/06
 * @Description:
 */
@Getter
public enum OTCBeneficiarysEnum {


    //收款类型
//    MONEYTYPE_CNY(1,"CNY"),
//    MONEYTYPE_KRW(2,"KRW"),
//    MONEYTYPE_USD(3,"USD"),
//    MONEYTYPE_EUR(4,"EUR"),
//    MONEYTYPE_SGD(5,"SGD"),
//    MONEYTYPE_VND(6,"VND"),
//    MONEYTYPE_MYR(7,"MYR"),


    
    //是否显示此交易类型  1-显示  2-不显示
    isdisplay_show(1,"show"),
	isdisplay_hide(2,"hide"),
    ;
    private Integer code;
    private String type;
    OTCBeneficiarysEnum(Integer code){
        this.code = code;
    }
    OTCBeneficiarysEnum(String type){
        this.type = type;
    }

    OTCBeneficiarysEnum(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    @Getter
    @AllArgsConstructor
    public enum PayMethodEnum{
        //支付方式 (1-支付宝 2-微信 3-银行)
        TYPE_ALIPAY(1,"ALIPAY"),
        TYPE_WEIXIN(2,"WEIXIN"),
        TYPE_BANK(3,"BANK"),
        TYPE_PAYPAL(4,"PAYPAL"),
        TYPE_KAKAO_PAY(5,"KakaoPay"),
        TYPE_NAVER_PAY(6,"NaverPay"),
        TYPE_PAYNOW(7,"Paynow"),//新加坡
        TYPE_BROKERAGE(8,"ZaloPay"),//越南
//        TYPE_VISA(7,"VISA"),
//        TYPE_MASTERCARD(8,"MASTERCARD"),
        ;

        private Integer code;
        private String type;

        public static Integer getTemplate(Integer status){
            for (PayMethodEnum value : PayMethodEnum.values()) {
                if (value.getCode().equals(status)){
                    return value.getCode();
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum PayUnitEnum{
        //支持的法币
        MONEYTYPE_CNY(1,"CNY"),
        MONEYTYPE_KRW(2,"KRW"),
        MONEYTYPE_USD(3,"USD"),
        MONEYTYPE_EUR(4,"EUR"),
        MONEYTYPE_SGD(5,"SGD"),
        MONEYTYPE_VND(6,"VND"),
        MONEYTYPE_MYR(7,"MYR"),
        MONEYTYPE_IRR(8,"IRR"),
//        TYPE_VISA(7,"VISA"),
//        TYPE_MASTERCARD(8,"MASTERCARD"),
        ;

        private Integer code;
        private String type;

        public static Integer getPayUnit(String unit){
            for (PayUnitEnum value : PayUnitEnum.values()) {
                if (value.getType().equals(unit)){
                    return value.getCode();
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum CountryEnum{
        //支持的国家
        Country_China(37,"China"),
        Country_Korea(88,"Korea"),
        Country_Singapore(153,"Singapore"),
        Country_USA(183,"USA"),
        Country_Vietnam(187,"Vietnam"),
        Country_Malaysia(103,"Malaysia"),
        Country_Iran(76,"Iran"),
        ;

        private Integer code;
        private String country;

        public static String getCountry(Integer country){
            for (CountryEnum value : CountryEnum.values()) {
                if (value.getCode().equals(country)){
                    return value.getCountry();
                }
            }
            return CountryEnum.Country_China.getCountry();
        }
    }

}
